package com.gameShare.mappers.misc

import com.gameShare.entity.dto.game.GameCommentDto
import com.gameShare.entity.dto.user.UserCenterCommentDto
import org.apache.ibatis.annotations.Param
import java.util.Date

interface GameCommentMapper {

    fun selectChildrenGameComment(@Param("id") id : String) : GameCommentDto

    fun selectCommentByGameId(
        @Param("gameId") gameId : String,
        @Param("start") start : Int,
        @Param("end") end : Int
    ) : List<GameCommentDto?>

    fun selectTopCommentCountByGameId(@Param("gameId") gameId: String) : Int

    fun insertGameComment(
        @Param("gameId") gameId: String,
        @Param("userId") userId : String,
        @Param("pCommentId") pCommentId : Int?,
        @Param("content") content : String,
        @Param("postTime") postTime : Date
    ) : Int

    fun selectPCommentIdByGameId(@Param("gameId") gameId: String) : List<Int>

    fun selectPCommentUserId(@Param("pCommentId") pCommentId: Int) : String

    fun selectUserCenterComment(
        @Param("userId") userId: String,
        @Param("start") start: Int,
        @Param("end") end : Int
    ) : List<UserCenterCommentDto?>

    fun selectUserCenterCommentCount(@Param("userId") userId: String) : Int

    fun checkCommentInGame(
        @Param("gameId") gameId: String,
        @Param("commentId") commentId : Int
    ) : Int

}